﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Base.Master" AutoEventWireup="true" CodeBehind="Services.aspx.cs" Inherits="masterview.WebForm1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:GridView ID="GridView1" Width="100%" runat="server" AutoGenerateColumns="False" 
    DataSourceID="ApplicationConfiguration" AllowPaging="True" AllowSorting="True" 
        CellPadding="4" ForeColor="#333333" GridLines="None">
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
    <Columns>      
        <asp:TemplateField HeaderText="Service" SortExpression="COMPUTER_NAME">
            <ItemTemplate>
                <b><span style='color: <%#((bool)Eval("IS_ACTIVE")) ? "green":"red"%>;'><%#Eval("COMPUTER_NAME")%></b>
                <br/>
                <span style="font-size: smaller; color: Gray;">
                ID: <%#Eval("INSTALL_ID")%>
                <br/>
                Database: <span style="color: deeppink;"><%# ((String)Eval("SETTING_VALUE")).Substring(((String)Eval("SETTING_VALUE")).IndexOf("CMNBS"),((String)Eval("SETTING_VALUE")).IndexOf(";P")-((String)Eval("SETTING_VALUE")).IndexOf("CMNBS")) %></span>
                <br/>
                Connection String: <%#Eval("SETTING_VALUE")%></span>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:CheckBoxField DataField="IS_ACTIVE" HeaderText="Is Active" 
            SortExpression="IS_ACTIVE" />
    </Columns>
        <EditRowStyle BackColor="#999999" />
        <EmptyDataTemplate>
            No Records
        </EmptyDataTemplate>
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#E9E7E2" />
        <SortedAscendingHeaderStyle BackColor="#506C8C" />
        <SortedDescendingCellStyle BackColor="#FFFDF8" />
        <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
</asp:GridView>
<asp:SqlDataSource ID="ApplicationConfiguration" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ApplicationConfiguration %>" 
    
        SelectCommand="SELECT APPLICATION_INSTALL.INSTALL_ID, APPLICATION_INSTALL.COMPUTER_NAME, APPLICATION_INSTALL.IS_ACTIVE, APPLICATION_INSTALL_SETTINGS.SETTING_VALUE FROM APPLICATION_INSTALL INNER JOIN APPLICATION_INSTALL_MAP ON APPLICATION_INSTALL.INSTALL_ID = APPLICATION_INSTALL_MAP.INSTALL_ID INNER JOIN APPLICATION_INSTALL_SETTINGS ON APPLICATION_INSTALL_MAP.INSTALL_MAP_ID = APPLICATION_INSTALL_SETTINGS.INSTALL_MAP_ID WHERE (APPLICATION_INSTALL_SETTINGS.SETTING_NAME = 'CMSConnectionString') ORDER BY APPLICATION_INSTALL.INSTALL_ID">
</asp:SqlDataSource>
</asp:Content>
